FROM openeuler-22.03-lts-sp4:latest

COPY openEuler.repo /etc/yum.repos.d/openEuler.repo

RUN set -eux; \
    dnf install -y glibc-all-langpacks && dnf clean all

ARG GO_VERSION=1.24.4

RUN set -eux; \
    mkdir /opt/go && \
    curl -o go.tar.gz https://mirrors.ustc.edu.cn/golang/go${GO_VERSION}.linux-arm64.tar.gz && \
    tar -zxf go.tar.gz -C /opt/go --strip-components=1 && \
    rm -rf go.tar.gz && \
    mkdir /root/go

ENV PATH /opt/go/bin:/root/go:$PATH

RUN set -eux; \
    go env -w GOPROXY='https://goproxy.cn,direct' && \
    go env -w GOSUMDB='sum.golang.google.cn'

ENV LANG en_US.UTF-8

VOLUME ["/root/go"]

CMD ["go", "version"]
